package cn.tedu.spring.config;

import cn.tedu.spring.eg1.Product;
import cn.tedu.spring.file.Datebase;
import jdk.jfr.DataAmount;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestSpringConfig {
    public static void main(String[] args) {
        //创建IoC容器，会有大量Spring Bean对象存入IoC容器中
        ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取Datebase的Bean对象
        Datebase datebase = context.getBean(Datebase.class);
        System.out.println(datebase);
        //
        Product product= context.getBean(Product.class);
        System.out.println(product);
    }
}
